<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		    //格式化请求参数
    function formatParams(data){
        var arr=[];
		for(var item in data){
			arr.push(item+"="+data[item])
		}
		return	arr.join("&")
    }	
	var data={
		name:"张三",
		age:10,
		password:"123456"
	}	
	console.log(formatParams(data))
	</script>
</html>
